* These values can be used with a `GCompareFunc`. However,
* a `GCompareFunc` is allowed to return any integer values.
* For converting such a value to a `GtkOrdering` value, use
- * [func@Gtk.ordering_from_cmpfunc].
+ * [func@Gtk.Ordering.from_cmpfunc].
*/
typedef enum {
GTK_ORDERING_SMALLER = -1,
GTK_ORDERING_LARGER = 1
} GtkOrdering;
+/* The GI scanner does not handle static inline functions, because
+ * of the `static` keyword; so we clip this out when parsing the
+ * header, and we replace it with a real function in gtksorter.c
+ * that only exists when parsing the source for introspection.
+ */
+#ifdef __GI_SCANNER__
+GtkOrdering gtk_ordering_from_cmpfunc (int cmpfunc_result);
+#else
/**
* gtk_ordering_from_cmpfunc:
* @cmpfunc_result: Result of a comparison function
{
return (GtkOrdering) ((cmpfunc_result > 0) - (cmpfunc_result < 0));
}
+#endif
/**
* GtkPageOrientation:
gtk_sorter_changed (self, change);
}
+
+/* See the comment in gtkenums.h as to why we need to play
+ * games with the introspection scanner for static inline
+ * functions
+ */
+#ifdef __GI_SCANNER__
+/**
+ * gtk_ordering_from_cmpfunc:
+ * @cmpfunc_result: Result of a comparison function
+ *
+ * Converts the result of a `GCompareFunc` like strcmp() to a
+ * `GtkOrdering` value.
+ *
+ * Returns: the corresponding `GtkOrdering`
+ **/
+GtkOrdering
+gtk_ordering_from_cmpfunc (int cmpfunc_result)
+{
+ return (GtkOrdering) ((cmpfunc_result > 0) - (cmpfunc_result < 0));
+}
+#endif